// Copyright 2007-2008 Rory Plaire (codekaizen@gmail.com)

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace NPack.Interfaces
{
    /// <summary>
    /// A vector.
    /// </summary>
    /// <typeparam name="T">Type of components in the vector.</typeparam>
    [SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")]
    public interface IVector<T> : IMatrix<T>, IEnumerable<T>, 
                                  IComputable<Double, IVector<T>>, 
                                  IEquatable<IVector<T>>, IComparable<IVector<T>>
        where T : IEquatable<T>, IComparable<T>, IComputable<T>, IConvertible
    {
        /// <summary>
        /// Creates a component-by-component copy of the vector.
        /// </summary>
        /// <returns>A copy of the vector.</returns>
        new IVector<T> Clone();

        /// <summary>
        /// Gets the number of components in the vector.
        /// </summary>
        Int32 ComponentCount { get; }

        /// <summary>
        /// Gets or sets the vector component array.
        /// </summary>
        [SuppressMessage("Microsoft.Performance", "CA1819:PropertiesShouldNotReturnArrays")]
        T[] Components { get; set; }

        /// <summary>
        /// Returns the vector multiplied by -1.
        /// </summary>
        /// <returns>The vector when multiplied by -1.</returns>
        new IVector<T> Negative();

        /// <summary>
        /// Gets or sets a component in the vector.
        /// </summary>
        /// <param name="index">The index of the component.</param>
        /// <returns>The value of the component at the given <paramref name="index"/>.</returns>
        T this[Int32 index] { get; set; }
    }
}